<template>
  <div class="login-container">
    <div class="form-container">
      <h2>Haredot后台管理系统</h2>
      <form>
        <div class="form-group">
          <label for="username">用户名</label>
          <input type="text" id="username" v-model="username" />
        </div>
        <div class="form-group">
          <label for="password">密码</label>
          <input type="password" id="password" v-model="password" />
        </div>
        <div class="form-group remember">
		  <Switch v-model="rememberMe">
			   <template #open>
				<span>ON</span>
			   </template>
			   <template #close>
				 <span>OFF</span>
			   </template>
		  </Switch><label>记住我</label>
     
        </div>
        <button type="submit" @click.prevent="handleSubmit">登录</button>
      </form>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Login',
  data() {
    return {
      username: '',
      password: '',
      rememberMe: true,
    };
  },
  methods: {
    handleSubmit() {
      // 在这里处理表单提交逻辑
      console.log('用户名：', this.username);
      console.log('密码：', this.password);
      console.log('记住我：', this.rememberMe);
	  this.$router.push("/");
    },
  },
};
</script>

<style scoped>
.login-container {
  background-image: linear-gradient(to bottom right, #88bdbc, #ffe5b4);
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-container {
  background-color: rgba(255, 255, 255, 0.9);
  padding: 50px;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.remember {
	text-align: right; 
}

h2 {
  margin-bottom: 20px;
  text-align: center;
  color: #5c5c5c;
}

form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

label {
  display: inline-block;
  margin-bottom: 5px;
  color: #5c5c5c; 
  width: 80px; 
  padding:0 15px;
  text-align: right;
  box-sizing: border-box;
}

label[for=rememberMe] {
	padding: 0 15px 0 5px;
	text-align: left;
	width: auto;
}

input[type='text'],
input[type='password'] {
  width: 460px;
  height: 40px;
  padding: 5px;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  background-color: #f5f5f5;
  color: #5c5c5c;
}

input[type='text']:focus,
input[type='password']:focus {
  outline: none;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

input[type='checkbox'] {
  display: inline-block;
  margin-right: 10px;
  transform: translateY(2px);
}

button[type='submit'] {
  height: 40px;
  border: none;
  border-radius: 5px;
  background-color: #5c5c5c;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

button[type='submit']:hover {
  background-color: #444;
}


</style>
